/**
 * 
 */
package com.cbank.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.cbank.dao.UserCompanyDao;
import com.cbank.domain.UserCompany;

/**
 * <p>
 * Title:
 * </p>
 * <p>
 * Description:cBank
 * </p>
 * <p>
 * Contact: 1027448479@qq.com
 * </p>
 * 
 * @author Ag
 * @date 2016年12月13日
 */
@Service
public class UserCompanyService {
	@Autowired
	private UserCompanyDao dao;

	public void save(UserCompany obj) {
		this.dao.insert(obj);
	}

	public UserCompany getById(Long id) {
		UserCompany company = dao.getById(id);
		return company;
	}

	public List<UserCompany> getList(Integer index, Integer pagerSize) {
		return this.dao.getPage(index, pagerSize);
	}

	public Integer getCount() {
		return dao.getCount();
	}
	/**
	 * 得到该用户总共下载数量
	 * @param userId
	 * @return
	 */
	public int getTotalCountByUserId(long userId) {
		return dao.getTotalCountByUserId(userId);
	}
	public List<UserCompany> getListByUserId(long userId) {
		return dao.getListByUserId(userId);
	}
}
